#include <iostream>
#include <sstream>
#include <bitset>
#include <vector>
#include <iterator>
#include <cstdlib>
using namespace std;


bool Jolly_Jumpers(short size, const vector<short>& seq) {
	if(size == 1) {
		return true;
	} else {
		vector<short>::const_iterator cur = seq.begin();	
		vector<short>::const_iterator next = cur+1;
		bitset<3000> hash;
		bitset<3000> value;	
		short mask = 0;
		while(next != seq.end()) {
			short index= abs((*next) - (*cur))-1;
			if(index < 0 || index > (size-2) || hash.test(index) == true) {
				return false;
			} else {
				hash.set(index);	
			}
			value.set(mask);
			mask++;
			next++;
			cur++;
		}
		return (value == hash);
	}
}

int main() {
	stringstream oss(stringstream::in | stringstream::out);
	while(cin.eof() != true) {
		string line;
		unsigned short number = 0;
		cin >> number;
		cin >> ws;
		getline(cin, line);
		oss.clear();
		oss << line;
		vector<short> sequence((istream_iterator<short>(oss)), (istream_iterator<short>()));
		if(sequence.size() > 0 && sequence.size() == number) {
			bool result = Jolly_Jumpers(sequence.size(), sequence);
			result ? (cout << "Jolly" << endl) : (cout << "Not jolly" << endl);
		}
	}
	return 0;	
}
